package me.mcx.mcx.service.impl;

import java.util.List;
import me.mcx.common.utils.DateUtils;
import me.mcx.mcx.domain.McxCourse;
import me.mcx.mcx.mapper.McxCourseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import me.mcx.mcx.service.IMcxCourseService;

/**
 * 发展历程Service业务层处理
 * 
 * @author mcx
 * @date 2024-09-21
 */
@Service
public class McxCourseServiceImpl implements IMcxCourseService 
{
    @Autowired
    private McxCourseMapper mcxCourseMapper;

    /**
     * 查询发展历程
     * 
     * @param id 发展历程主键
     * @return 发展历程
     */
    @Override
    public McxCourse selectMcxCourseById(Long id)
    {
        return mcxCourseMapper.selectMcxCourseById(id);
    }

    /**
     * 查询发展历程列表
     * 
     * @param mcxCourse 发展历程
     * @return 发展历程
     */
    @Override
    public List<McxCourse> selectMcxCourseList(McxCourse mcxCourse)
    {
        return mcxCourseMapper.selectMcxCourseList(mcxCourse);
    }

    /**
     * 新增发展历程
     * 
     * @param mcxCourse 发展历程
     * @return 结果
     */
    @Override
    public int insertMcxCourse(McxCourse mcxCourse)
    {
        mcxCourse.setCreateTime(DateUtils.getNowDate());
        return mcxCourseMapper.insertMcxCourse(mcxCourse);
    }

    /**
     * 修改发展历程
     * 
     * @param mcxCourse 发展历程
     * @return 结果
     */
    @Override
    public int updateMcxCourse(McxCourse mcxCourse)
    {
        mcxCourse.setUpdateTime(DateUtils.getNowDate());
        return mcxCourseMapper.updateMcxCourse(mcxCourse);
    }

    /**
     * 批量删除发展历程
     * 
     * @param ids 需要删除的发展历程主键
     * @return 结果
     */
    @Override
    public int deleteMcxCourseByIds(Long[] ids)
    {
        return mcxCourseMapper.deleteMcxCourseByIds(ids);
    }

    /**
     * 删除发展历程信息
     * 
     * @param id 发展历程主键
     * @return 结果
     */
    @Override
    public int deleteMcxCourseById(Long id)
    {
        return mcxCourseMapper.deleteMcxCourseById(id);
    }
}
